package arch.coal.ellipse.security.tables;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;

import org.apache.log4j.Logger;

import arch.coal.ellipse.security.data.MSF034_audit;
import arch.coal.ellipse.security.utils.StringUtil;



public class TableMSF034 extends BasicTable {
	
	private LinkedList dataList;
	static Logger logger = Logger.getLogger(TableMSF020.class);
	
	public TableMSF034() {
		setTableName("MSF034");
	}
	
	void populateSqlSelectStmt() {
		sqlSelectStmt.append("SELECT");
		sqlSelectStmt.append(" date_gmt, time_gmt, seqnce_no, file_no, audit_type,");
		sqlSelectStmt.append(" audit_status, location_code, program_name, user_id,");
		sqlSelectStmt.append(" file_imagesx1, file_imagesx2, file_imagesx3,");
		sqlSelectStmt.append(" file_imagesx4, file_imagesx5, file_imagesx6 ");
		sqlSelectStmt.append("FROM msf034 ");
	}
	
	void setTableName(String table) {
		tableName = "MSF034";
	}

	public void processResultSet(ResultSet rs) {
		
		dataList = new LinkedList();
		
		try {
			while ( rs.next() ) {
				MSF034_audit data = new MSF034_audit();
				data.setDate_gmt(StringUtil.check(rs.getString(1)));
				data.setTime_gmt(StringUtil.check(rs.getString(2)));
				data.setSeqnce_no(StringUtil.check(rs.getString(3)));
				data.setFile_no(StringUtil.check(rs.getString(4)));
				data.setAudit_type(StringUtil.check(rs.getString(5)));
				data.setAudit_status(StringUtil.check(rs.getString(6)));
				data.setLocation_code(StringUtil.check(rs.getString(7)));
				data.setProgram_name(StringUtil.check(rs.getString(8)));
				data.setUser_id(StringUtil.check(rs.getString(9)));
				data.setFile_imagesx1(StringUtil.check(rs.getString(10)));
				data.setFile_imagesx2((rs.getString(11)));
				data.setFile_imagesx3(StringUtil.check(rs.getString(12)));
				data.setFile_imagesx4(StringUtil.check(rs.getString(13)));
				data.setFile_imagesx5(StringUtil.check(rs.getString(14)));
				data.setFile_imagesx6(StringUtil.check(rs.getString(15)));
				
				dataList.add(data);
			}
		} catch (SQLException se) {
			logger.error("EXCEPTION while getting result set", se);
			se.printStackTrace();
		}
	}
	
	public LinkedList getDataList() {
		return dataList;
	}

}
